Skip to content

Ensure default groups for docs are sorted alphabetically #2132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

lud
Copy link
Contributor

@lud lud commented Jun 18, 2025

First attempt at the docs. Docs are hard, as always.

I splitted the different concepts (attaching to groups / descriptions / ordering) for clarity, not sure if it is OK.

We may want to fix default ordering (displaying groups from :default_group_for_doc before Types,Functions,Callbacks) and update the docs before merging this.

Copy link

github-actions bot commented Jun 18, 2025

@josevalim
Copy link
Member

We may want to fix default ordering (displaying groups from :default_group_for_doc before Types,Functions,Callbacks) and update the docs before merging this.

Are you planning to send a PR for this too? :) You can also amend this one if you prefer!

@lud
Copy link
Contributor Author

lud commented Jun 18, 2025

Are you planning to send a PR for this too? :) You can also amend this one if you prefer!

If we have to fix it then yes I'll update this PR.

@josevalim
Copy link
Member

Yes, I should probably preserve it to avoid breaking changes, unless it would add a lot of complexity or complications. I am hoping it is rather just swapping operands somewhere :D

@lud
Copy link
Contributor Author

lud commented Jun 18, 2025

Yeah ok, it should not be that hard.

@lud lud force-pushed the doc-groups-doc branch from 6d7b641 to 8d92e91 Compare June 23, 2025 06:11
@lud
Copy link
Contributor Author

lud commented Jun 23, 2025

@josevalim Well it's actually already the case in version 0.37: "Functions" appear before groups from :default_group_for_docs. If I try to change that a test breaks.

So I'm just going to sort groups from :default_group_for_doc by name to keep the previous behaviour.

@lud
Copy link
Contributor Author

lud commented Jun 23, 2025

Yeah, without any default configuration, with 0.37.3 or 0.38.2 the following code:

  @doc group: "Z group last"
  def aaa, do: []

  @doc group: "A Group second"
  def zzz, do: []

  def mmm, do: []

...produces the following:

image

So I'd rather keep that behaviour and document it, as there is now a second simple way to control ordering!

(But I did make a change to sort those default groups by alphabetical order.)

@lud lud force-pushed the doc-groups-doc branch from 8d92e91 to 69c10f0 Compare June 23, 2025 06:33
@lud lud changed the title Document descriptions for doc groups Ensure default groups for docs are sorted alphabetically. Jun 23, 2025
@lud lud changed the title Ensure default groups for docs are sorted alphabetically. Ensure default groups for docs are sorted alphabetically Jun 23, 2025
@lud lud force-pushed the doc-groups-doc branch from 799c344 to 8d516cb Compare June 23, 2025 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants